package com.scmt.hmzd.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.scmt.hmzd.entity.HmOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ycy
 * @since 2023-03-07
 */
public interface HmOrderMapper extends BaseMapper<HmOrder> {

    List<HmOrder> listUnRefundOrderAndOrderItems(@Param("orderStatus") Integer orderStatus, @Param("lessThanUpdateTime") DateTime lessThanUpdateTime);

    void cancelOrders(@Param("orders") List<HmOrder> orders);

    Map<String, Object> statisticsOrderData();

    List<Map<String, Object>> queryWeekData();

    List<HmOrder> listUnCloseOrder();

    IPage<HmOrder> queryOrderListDataByPage(@Param(Constants.WRAPPER) QueryWrapper<HmOrder> queryWrapper, @Param("page") Page page);

}
